<template>
  <div>
    <div>全选:<input v-model="inss" type="checkbox"></div>
    <div v-for="(val,index) in smg" :key="index"><ul>
      <li>{{ val.name }}<input v-model="val.c" type="checkbox"></li>
    </ul></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      smg: [{ name: '白龙马', c: false }, { name: '白龙马', c: false }, { name: '白龙马', c: false }, { name: '白龙马', c: false }]
    }
  },
  computed: {
    inss: {
      set(val) {
        this.smg.forEach(item => {
          item.c = val
        })
      },
      get() {
        return this.smg.every(item => item.c === true)
      }
    }
  },
  methods: {
    // asd() {
    //   this.inss = this.smg.every(item => item.c === true)
    // }
  }
}
</script>

<style>

</style>
